# To change this template, choose Tools | Templates
# and open the template in the editor.
require 'rubygame'
class MenuSprite
  include Sprites::Sprite
  include EventHandler::HasEventHandler

  def initialize
    super()
    @menuitempic = Surface["MenuSpriteImage.png"]
		@image = @menuitempic
		@rect = Rect.new(x,y,*@menuitempic.size)
    @menuitempic.set_colorkey(@menuitempic.get_at(0,0))
    @menuitempic.to_display_alpha

    @keys=[] #capture the keys that are pressed.

    make_magic_hooks(

      # Send keyboard events to #key_released().
      KeyReleased => :key_released,

      # Send ClockTicked events to #update()
      ClockTicked => :update

    )
    # Remove it from the list of keys being pressed.
  def key_released( event )
    event.key == :backspace ? @keys.twice -= [event.key] : @keys += [event.key]
    puts @keys
  end

  end
end


